package com.wbl.train.common.business.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.time.LocalDate;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.experimental.Accessors;

/**
 * @author 王博纶
 * @since 2024-03-04
 * @description 确认订单
 */
@Data
@Accessors(chain = true)
@TableName("confirm_order")
@Schema(name = "ConfirmOrder 对象", description = "确认订单 实体类")
public class ConfirmOrderEntity {

    @Schema(description = "id")
    @JsonSerialize(using = ToStringSerializer.class)
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;

    @Schema(description = "会员id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long memberId;

    @Schema(description = "日期")
    private LocalDate date;

    @Schema(description = "车次编号")
    private String trainCode;

    @Schema(description = "出发站")
    private String start;

    @Schema(description = "到达站")
    private String end;

    @Schema(description = "余票ID")
    private Long dailyTrainTicketId;

    // 响应给前端的时候不序列化该字段
    @JsonIgnore
    @Schema(description = "车票")
    private String tickets;

    @Schema(description = "订单状态|枚举[ConfirmOrderStatusEnum]")
    private String status;

    @Schema(description = "新增时间")
    private Date createTime;

    @Schema(description = "修改时间")
    private Date updateTime;


}
